//
//  CustomAnnotationView.m
//  FleaFinder
//
//  Created by Hieu Le on 4/24/13.
//  Copyright (c) 2013 Kiwiweb. All rights reserved.
//

#import "CustomAnnotationView.h"

@implementation CustomAnnotationView

@synthesize lblAddress, lblCity, lblDate, lblMarkedType, lblName, lblStande, lblTime;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

-(void) displayMarket: (Marked*) marked
{
    lblName.text = marked.markedname;
    lblAddress.text = marked.road;
    lblMarkedType.text = marked.type != nil ? marked.type : marked.marketType.name;
    lblCity.text = [NSString stringWithFormat:@"%@ %@", marked.zip, marked.city];
    lblDate.text = [NSString stringWithFormat:@"d.%@ - %@", (marked.datefrom == nil ? @"" : marked.datefrom), (marked.dateto == nil ? @"" : marked.dateto)];
    lblTime.text = [NSString stringWithFormat:@"Tid: %@ - %@", marked.startat == nil ? @"" : marked.startat, marked.endat == nil ? @"" : marked.endat];
    lblStande.text = marked.stande;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
